<template>
  <nm-container>
    <el-form label-width="80px" :inline="true" style="background:white; padding:20px">
      <el-form-item label="日期选择" prop="station_id">
        <el-date-picker v-model="date" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> </el-date-picker>
      </el-form-item>
      <el-button type="primary" @click="getDetails">查询</el-button>
    </el-form>
    <div class="Dh_table">
      <el-table
        highlight-current-row
        :max-height="height"
        @current-change="handleCurrentChange"
        ref="topictable"
        :data="getList"
        border
        align="center"
        :header-cell-style="{ 'text-align': 'center', color: '#030202', background: '#00BFFF' }"
        :cell-style="{ 'text-align': 'center' }"
        style="width: 100%;text-align: center;"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column prop="sellTicketAmount" label="售票张数"> </el-table-column>
        <el-table-column prop="ticketMoney" label="售票款"> </el-table-column>
        <el-table-column prop="changeFee" label="改签手续费"> </el-table-column>
        <el-table-column prop="refundTicketAmount" label="退票张数"> </el-table-column>
        <el-table-column prop="refundFee" label="退票手续费"> </el-table-column>
        <el-table-column prop="refundMoney" label="退票款"> </el-table-column>
        <el-table-column prop="getTicketAmount" label="取票张数"> </el-table-column>
        <el-table-column prop="getTicketMoney" label="取票款"> </el-table-column>
      </el-table>
    </div>

    <el-pagination background layout="prev, pager, next" :total="total / 10" />
  </nm-container>
</template>
<script>
import { mixins } from 'netmodular-ui'
import page from './page'

const api = $api.dispatch.today_bill

export default {
  name: page.name,
  mixins: [mixins],
  data() {
    return {
      date: '',
      getList: [],
      total: '',
      height: 400
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.height = window.innerHeight - this.$refs.topictable.$el.offsetTop - 150
    })
  },
  methods: {
    handleCurrentChange(data) {
      console.log(data)
    },
    handleSelectionChange(val) {
      console.log(val)
    },
    // 获取个人明细
    getDetails() {
      api.queryuserdaybill({ date: this.date }).then(res => {
        this.getList = res.userDayBill
      })
    }
  }
}
</script>

<style></style>
